package com.zombie;

import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.Texture;
import com.zombie.input.Input;
import com.zombie.logic.Material;
import com.zombie.logic.core.ZombieWorld;
import com.zombie.logic.item.Item;
import com.zombie.state.CharState;
import com.zombie.state.GameState;
import com.zombie.state.MenuState;
import com.zombie.state.OptionsState;
import com.zombie.util.state.State;
import com.zombie.util.state.StateBasedGame;

public class ZombieGame extends StateBasedGame {

	private static ZombieGame instance = new ZombieGame();
	public static Input input;
	
	public static ZombieGame getInstance(){
		return instance;
	}

	@Override
	public void initStatesList() {
		addState(MenuState.getInstance());
		addState(CharState.getInstance());
		addState(GameState.getInstance());
		addState(OptionsState.getInstance());
	}
	
	@Override
	public void resize(int width, int height) {
		for(State s : states.values())
			s.resize(width,height);
	}

	@Override
	public void pause() {

	}

	@Override
	public void resume() {

	}

	@Override
	public void dispose() {

	}

	@Override
	public void init() {
		Texture.setEnforcePotImages(false);
		ResourceManager.getInstance().init();
		ZombieWorld.getInstance();
		Item.reload();
		Material.reload();
		Gdx.input.setInputProcessor(input = new Input());
	}
}
